package all_in_one;

public class Constraint_Toby extends Thread {
	private CigarettePlace m_place;
	
	public Constraint_Toby(CigarettePlace place) {
		m_place = place;
	}
	public void run() {
		while (true) {
			FinishSmoke();
			//System.out.println("Toby wants to smoke");
		}
	}
	public synchronized void FinishSmoke() {
		m_place.GetToby().GetSemaphore().acquireUninterruptibly();
		System.out.println("Toby finished smoking");
		m_place.GetAggySemaphore().release();
	}
}
